package com.example.batch.shell;

import com.example.batch.entity.User;
import com.example.batch.mapper.batch.UserMapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.shell.standard.ShellComponent;
import org.springframework.shell.standard.ShellMethod;

import java.util.List;

@ShellComponent
public class TestShell {

    private final UserMapper userMapper;

    @Autowired
    public TestShell(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    @ShellMethod("List Users:")
    public List<User> list(){
        PageHelper.startPage(1, 30);
        return userMapper.selectList(new User());
    }

}
